<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><% model(2); %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="15" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="php.js"></script>
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="general.js"></script>
<!-- {{{ --><script type="text/javascript">mdm = <% modem_status(); %>;</script><!-- }}} -->
<script type="text/javascript">
	$(document).ready(function() {
		load_body();
		if (typeof mdm.err !== 'undefined')
			$('#mdm0_modem').html(mdm.err);
		else {
			$('#mdm0_modem').html(mdm.modem);
			if (typeof mdm.oper !== 'undefined') {
				$('#mdm0_oper').html(mdm.oper);
				if (typeof mdm.mcc !== 'undefined') {
					$('#mdm0_cell').html(sprintf('PLMN: %s%s', mdm.mcc, mdm.mnc));
					if (typeof mdm.lac !== 'undefined')
						$('#mdm0_cell').append(sprintf(', LAC: %X, Cell ID: %X', mdm.lac, mdm.ci));
				}
			}
			if (mdm.rssi) {
				if (mdm.rscp) {
					$('#mdm0_sig').html(sprintf('<span title="RSSI %d dBm">RSCP %d dBm<\/span>', mdm.rssi, mdm.rscp));
					// assume Ec/Io can't be 0 for simplicity, though it's a valid value
					if (mdm.ecio)
						$('#mdm0_sig').append(sprintf(', Ec/Io %d dB', mdm.ecio));
				}
				else if (mdm.rsrp) {
					$('#mdm0_sig').html(sprintf('<span title="RSSI %d dBm">RSRP %d dBm<\/span>', mdm.rssi, mdm.rsrp));
					if (mdm.rsrq)
						$('#mdm0_sig').append(sprintf(', RSRQ %d dB', mdm.rsrq));
					if (mdm.sinr != 99)
						$('#mdm0_sig').append(sprintf(', SINR %d dB', mdm.sinr));
				}
				else
					$('#mdm0_sig').html(sprintf('RSSI %d dBm', mdm.rssi));
			}
			if (typeof mdm.system !== 'undefined')
				$('#mdm0_system').html(mdm.system);
			if (typeof mdm.last_ds_time !== 'undefined') {
				$('#mdm0_last_ds').html(sprintf('%s <span class="darr">&darr;<\/span> %s <span class="uarr">&uarr;<\/span> %s',
					humanReadableDuration(mdm.last_ds_time),
					humanReadableSize(mdm.last_rx_flow), humanReadableSize(mdm.last_tx_flow)));
				$('#mdm0_total_ds').html(sprintf('%s <span class="darr">&darr;<\/span> %s <span class="uarr">&uarr;<\/span> %s',
					humanReadableDuration(mdm.total_ds_time),
					humanReadableSize(mdm.total_rx_flow), humanReadableSize(mdm.total_tx_flow)));
			}
		}
	});
</script>
</head>
<body>
<form method="get" name="form" id="form" action="apply.cgi">
<input type="hidden" name="current_page" value="modemstatus.asp" />
<input type="hidden" name="next_page" value="modemstatus.asp" />
<input type="hidden" name="next_host" value="" />
<input type="hidden" name="group_id" value="" />
<input type="hidden" name="modified" value="0" />
<input type="hidden" name="action_mode" value="" />
<input type="hidden" name="first_time" value="" />
<input type="hidden" name="action_script" value="" />

<table class="main">
<thead>
<tr>
<td>Status &amp; Log - 3G/CDMA Modem</td>
</tr>
</thead>

<tr><td>
<table class="sect">
<tr>
<th>Modem:
           </th><td id="mdm0_modem"></td>
</tr>
<tr>
<th>Operator:
           </th><td id="mdm0_oper"></td>
</tr>
<tr>
<th>Cell Info:
           </th><td id="mdm0_cell"></td>
</tr>
<tr>
<th>Signal:
           </th><td id="mdm0_sig"></td>
</tr>
<tr>
<th>System:
           </th><td id="mdm0_system"></td>
</tr>
<tr>
<th>Last Session:
           </th><td id="mdm0_last_ds"></td>
</tr>
<tr>
<th>Total Sessions:
           </th><td id="mdm0_total_ds"></td>
</tr>
</table>
</td></tr>

</table>
	
<table class="foot">
<tr>  
   <td height="25" width="75%">&nbsp;</td>
   <td height="25">  
   <div align="center"><font face="Arial"> <input class="inputSubmit" onClick="onSubmitCtrl(this, ' Refresh ')" type="submit" value="Refresh" name="action" /></font></div> 
   </td>
</tr>
</table>

</form>
</body>
</html>